package com.gitee.xqlr.graphql.client.request.param;

import com.alibaba.fastjson.JSON;


/**
 * @author 杜文康
 * @version 1.0
 * @date 2019/8/12 15:18
 */
public class RequestObjPara {
    private Object data;

    /**
     * 构造参数
     *
     * @param data 数据
     */
    public RequestObjPara(Object data) {
        this.data = data;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return dataToJson();
    }

    /**
     * data转string
     *
     * @return data转string
     */
    private String dataToJson() {
        return JSON.toJSONString(getData(), 3088);
    }
}
